package study.innerClass;

public class OutClassTwo {



    public void test(){
        System.out.println("OueClassTwo的方法");
        //局部内部类(用的非常的少)
        class TestInnerClass{
            private int id;
            private String name;

            public TestInnerClass() {
            }

            public TestInnerClass(int id, String name) {
                this.id = id;
                this.name = name;
            }

            public void innersay(){
                System.out.println(this.id+"---"+this.name);
            }
        }
         //创建局部内部类（很少用）
        TestInnerClass testInnerClass = new TestInnerClass(1,"局部内部类");
        testInnerClass.innersay();
    }

    //匿名内部类
    public void hello(Dog dog){
        System.out.println(dog);
    }
}
